<template>
  <div class="el-mr-mathouseTable">
    <div class="el-mr-mh-firstbg">
      <el-table  ref="receiveTable" size="mini"  :data="resData"  style="width: 100%"   @selection-change="handleSelectionChange"  highlight-current-row  height="500">
        <el-table-column type="selection" width="40"></el-table-column>
        <el-table-column  type="index"  label="序号" width="50" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column  prop="rowNo"  label="巷道"  width="100"  :show-overflow-tooltip="true" > </el-table-column>
        <el-table-column  prop="rowNoCode"  label="巷道"  v-if="false"  :show-overflow-tooltip="true" > </el-table-column>
        <el-table-column  prop="shelvesCode"  label="货位编码" width="100" :show-overflow-tooltip="true" > </el-table-column>
        <el-table-column  prop="palletCode" label="操作盘编码"  width="130" :show-overflow-tooltip="true" > </el-table-column>
        <el-table-column  prop="transferPosition"  label="是否移库位置" width="100" :show-overflow-tooltip="true" > </el-table-column>
        <el-table-column prop="status" label="货位状态"  :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="statusCode" label="货位状态"  v-if="false"  :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="isEmpty" label="是否空箱" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="isEmptyCode" label="是否空箱" v-if="false" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="transferPosition" label="是否移库位" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="dependShelvesCode" label="依赖货位" width="130" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="lastUpdateDate" label="最后修改时间" width="130" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="height" label="货位高度" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="weight" label="货位承受最大重量" width="130" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="lastUpdatedBy" label="最后修改人"  :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="heightOfGoods" label="货品高度" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="remark" label="备注" :show-overflow-tooltip="true"> </el-table-column>
      </el-table>
      <!-- 分页 -->
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageNumber"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalCount"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import { sysLibraryData } from "@/utils/api.js";

export default {
  name: "MathouseTable",
  data() {
    return {
      // 当前页数
      pageNumber: 1,
      // 数据总个数
      totalCount: 0,
      // 返回的数据数组
      resData: [],
      // 每页数据个数  row'，'col'，'tmpRow'
      pageSize: 100,
    };
  },
  methods: {
    // 勾选函数
    handleSelectionChange(val) {
      // 将勾选的数据信息给 TopBtn-修改按钮
      this.$bus.$emit('sysSlChange',val)
      // 将勾选的数据信息给 TopBtn-删除按钮
      // this.$bus.$emit('sysTkDelete',val)
    },
    // 选择每页条数后请求接口更新表格
    handleSizeChange(val) {
      this.pageSize = val;
      // 传给首页
      this.$bus.$emit('sysSlPageSize',val)
    },
    // 分页函数
    handleCurrentChange(val) {
      this.pageNumber = val;
      // 传给首页
      this.$bus.$emit('sysSlPageNumber',val)
    },
  },
  mounted() {
    // 查询成功将数据给Table
    this.$bus.$on('sysSlSxTable',(e)=>{
      this.resData = e.data.list;
      this.totalCount = e.data.total;
    })

    sysLibraryData({
      searchParams: {
        rowNo:'',
        shelvesCode:'',
        hierarchy:'',
        col:'',
      },
      pageParameter: {
        rows: this.pageSize,
        page: 1,
      },
    }).then((res) => {
      console.log("立体库表格", res);
      this.resData = e.data.list;
      this.totalCount = e.data.total;
    });
  },
};
</script>
<style scoped>
.el-mr-mh-firstbg {
  width: 100%;
  height: 100%;
  text-align: center;
}
.el-pagination {
  text-align: center;
}
.el-mr-mathouseTable {
  height: 250px;
  /* background-color: red; */
}
</style>